Optimal. Leaf size=58 \[ \frac {(a c+b d) x}{a^2+b^2}+\frac {(b c-a d) \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right ) f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 58, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3612, 3611}
\begin {gather*} \frac {(b c-a d) \log (a \cos (e+f x)+b \sin (e+f x))}{f \left (a^2+b^2\right )}+\frac {x (a c+b d)}{a^2+b^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3611
Rule 3612
Rubi steps
\begin {align*} \int \frac {c+d \tan (e+f x)}{a+b \tan (e+f x)} \, dx &=\frac {(a c+b d) x}{a^2+b^2}+\frac {(b c-a d) \int \frac {b-a \tan (e+f x)}{a+b \tan (e+f x)} \, dx}{a^2+b^2}\\ &=\frac {(a c+b d) x}{a^2+b^2}+\frac {(b c-a d) \log (a \cos (e+f x)+b \sin (e+f x))}{\left (a^2+b^2\right ) f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.13, size = 66, normalized size = 1.14 \begin {gather*} \frac {2 (a c+b d) \text {ArcTan}(\tan (e+f x))-(b c-a d) \left (\log \left (\sec ^2(e+f x)\right )-2 \log (a+b \tan (e+f x))\right )}{2 \left (a^2+b^2\right ) f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.17, size = 83, normalized size = 1.43
method | result | size |
derivativedivides | \(\frac {-\frac {\left (a d -b c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{a^{2}+b^{2}}+\frac {\frac {\left (a d -b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a c +b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{a^{2}+b^{2}}}{f}\) | \(83\) |
default | \(\frac {-\frac {\left (a d -b c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{a^{2}+b^{2}}+\frac {\frac {\left (a d -b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a c +b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{a^{2}+b^{2}}}{f}\) | \(83\) |
norman | \(\frac {\left (a c +b d \right ) x}{a^{2}+b^{2}}+\frac {\left (a d -b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (a^{2}+b^{2}\right )}-\frac {\left (a d -b c \right ) \ln \left (a +b \tan \left (f x +e \right )\right )}{f \left (a^{2}+b^{2}\right )}\) | \(86\) |
risch | \(\frac {i x d}{i b -a}-\frac {x c}{i b -a}+\frac {2 i a d x}{a^{2}+b^{2}}-\frac {2 i b c x}{a^{2}+b^{2}}+\frac {2 i a d e}{f \left (a^{2}+b^{2}\right )}-\frac {2 i b c e}{f \left (a^{2}+b^{2}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) a d}{f \left (a^{2}+b^{2}\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i b +a}{i b -a}\right ) b c}{f \left (a^{2}+b^{2}\right )}\) | \(186\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.53, size = 92, normalized size = 1.59 \begin {gather*} \frac {\frac {2 \, {\left (a c + b d\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} + \frac {2 \, {\left (b c - a d\right )} \log \left (b \tan \left (f x + e\right ) + a\right )}{a^{2} + b^{2}} - \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.12, size = 78, normalized size = 1.34 \begin {gather*} \frac {2 \, {\left (a c + b d\right )} f x + {\left (b c - a d\right )} \log \left (\frac {b^{2} \tan \left (f x + e\right )^{2} + 2 \, a b \tan \left (f x + e\right ) + a^{2}}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (a^{2} + b^{2}\right )} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 0.47, size = 524, normalized size = 9.03 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x \left (c + d \tan {\left (e \right )}\right )}{\tan {\left (e \right )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {c x + \frac {d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f}}{a} & \text {for}\: b = 0 \\\frac {i c f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} - 2 i b f} + \frac {c f x}{2 b f \tan {\left (e + f x \right )} - 2 i b f} + \frac {i c}{2 b f \tan {\left (e + f x \right )} - 2 i b f} + \frac {d f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} - 2 i b f} - \frac {i d f x}{2 b f \tan {\left (e + f x \right )} - 2 i b f} - \frac {d}{2 b f \tan {\left (e + f x \right )} - 2 i b f} & \text {for}\: a = - i b \\- \frac {i c f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} + 2 i b f} + \frac {c f x}{2 b f \tan {\left (e + f x \right )} + 2 i b f} - \frac {i c}{2 b f \tan {\left (e + f x \right )} + 2 i b f} + \frac {d f x \tan {\left (e + f x \right )}}{2 b f \tan {\left (e + f x \right )} + 2 i b f} + \frac {i d f x}{2 b f \tan {\left (e + f x \right )} + 2 i b f} - \frac {d}{2 b f \tan {\left (e + f x \right )} + 2 i b f} & \text {for}\: a = i b \\\frac {x \left (c + d \tan {\left (e \right )}\right )}{a + b \tan {\left (e \right )}} & \text {for}\: f = 0 \\\frac {2 a c f x}{2 a^{2} f + 2 b^{2} f} - \frac {2 a d \log {\left (\frac {a}{b} + \tan {\left (e + f x \right )} \right )}}{2 a^{2} f + 2 b^{2} f} + \frac {a d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f + 2 b^{2} f} + \frac {2 b c \log {\left (\frac {a}{b} + \tan {\left (e + f x \right )} \right )}}{2 a^{2} f + 2 b^{2} f} - \frac {b c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a^{2} f + 2 b^{2} f} + \frac {2 b d f x}{2 a^{2} f + 2 b^{2} f} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 98, normalized size = 1.69 \begin {gather*} \frac {\frac {2 \, {\left (a c + b d\right )} {\left (f x + e\right )}}{a^{2} + b^{2}} - \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{a^{2} + b^{2}} + \frac {2 \, {\left (b^{2} c - a b d\right )} \log \left ({\left | b \tan \left (f x + e\right ) + a \right |}\right )}{a^{2} b + b^{3}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.68, size = 94, normalized size = 1.62 \begin {gather*} -\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-d+c\,1{}\mathrm {i}\right )}{2\,f\,\left (a+b\,1{}\mathrm {i}\right )}-\frac {\ln \left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a\,d-b\,c\right )}{f\,\left (a^2+b^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (c-d\,1{}\mathrm {i}\right )}{2\,f\,\left (b+a\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________